package com.icss.controller;

import com.icss.service.LogisticsService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author safe
 * @create 2022-08-31 13:23
 * @introduction
 */
@RestController
public class LogisticsController {
    private final LogisticsService logisticsService;
    public LogisticsController(LogisticsService logisticsService) {
        this.logisticsService = logisticsService;
    }

    @GetMapping("/logistic/hystrix/success/{id}")
    public String logisticSuccess(@PathVariable("id") Integer id){
        return logisticsService.logisticSuccess(id);
    }

    @GetMapping("/logistic/hystrix/TimeOut/{id}")
    public String logisticTimeout(@PathVariable("id") Integer id){
        return logisticsService.logisticTimeout(id);
    }

}
